import { defHttp } from '/@/utils/http/axios';

enum Api {
  loginfo = '/sys/loginfo',
  visitInfo = '/sys/visitInfo',
  statisticsInfo = '/items/labTaskAllot/personalCount',
  noticeInfo = '/sys/annountCement/listOne', //通知公告
  messageInfo = '/notify/labNotify/listOne', //消息通知
  todoTasksInfo = '/notify/labNotify/todo', //待办任务
  statisticsInfoList = '/items/labTaskAllot/monthCount', //统计图数据
  update = '/notify/labNotify/updateStatus', //修改消息状态
  manage = '/documents/labDocuments/list', //文档管理类
  technical = '/lab_technology/labTechnology/list', //文档技术类
  hasCommonFunctions = '/sys/role/byCommonModules', //获取已有的常用功能
  commonFunctions = '/sys/role/commonModules', //常用功能获取列表
  saveCommonFunctions = '/sys/role/addCommonModules',//保存常用模块
  getLeaderList='/jeecg-lab/labchart/chartAnls/kyXmAnalyseData'
}
/**
 * 日志统计信息
 * @param params
 */
export const getLoginfo = (params) => defHttp.get({ url: Api.loginfo, params }, { isTransformResponse: false });
/**
 * 访问量信息
 * @param params
 */
export const getVisitInfo = (params) => defHttp.get({ url: Api.visitInfo, params }, { isTransformResponse: false });

/**
 * 获取统计数据
 * @param params
 */
export const getStatisticsInfo = (params) => defHttp.get({ url: Api.statisticsInfo, params }, { isTransformResponse: false });

/**
 * 通知公告
 */
export const getNoticeInfo = () => defHttp.get({ url: Api.noticeInfo }, { isTransformResponse: false });

/**
 * 消息通知
 */
export const getMessageInfo = () => defHttp.get({ url: Api.messageInfo }, { isTransformResponse: false });
/**
 * 待办任务
 */
export const getTodoTasksInfo = (params) => defHttp.get({ url: Api.todoTasksInfo, params }, { isTransformResponse: false });
/**
 * 统计接口
 */
export const getStatisticsInfoList = (params) => defHttp.get({ url: Api.statisticsInfoList, params }, { isTransformResponse: false });

/*
 *修改消息状态：已读/未读
 */
export const update = (params) => {
  return defHttp.get({ url: Api.update, params }, { isTransformResponse: false });
};
/**
 * 文档接口
 */
/**
 * 文档管理类
 */
export const manageDocument = () => defHttp.get({ url: Api.manage }, { isTransformResponse: false });
/**
 * 文档技术类
 */
export const technicalDocument = () => defHttp.get({ url: Api.technical }, { isTransformResponse: false });

/**
 * 获取常用功能数据
 */
export const commonFunctionsList = () => defHttp.get({ url: Api.commonFunctions }, { isTransformResponse: false });
/**
 * 获取已有的常用功能
 */
export const hasCommonFunctionsList = () => defHttp.get({ url: Api.hasCommonFunctions }, { isTransformResponse: false });
/**
 * 保存常用功能
 */
export const saveCommonFunctionsList = (params) => defHttp.post({ url: Api.saveCommonFunctions, params }, { isTransformResponse: false })

/**
 * 领导首页请求接口
 */
export const leaderListInfo = (params) => defHttp.get({ url: Api.getLeaderList, params }, { isTransformResponse: false })